﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WJP.Logging
{
    [Serializable]
    public class ConsoleFactory : AbstractLoggerFactory
    {
        private LogLevel? level;

        public ConsoleFactory()
        {

        }

        public ConsoleFactory(LogLevel level)
        {
            this.level = level;
        }

        public override ILogger Create(string name)
        {
            if (level.HasValue)
                return Create(name, level.Value);

            return new ConsoleLogger(name);
        }

        public override ILogger Create(string name, LogLevel level)
        {
            return new ConsoleLogger(name, level);
        }
    }
}
